/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.refunite.mobile.webservice.formgenerator;

import java.util.ArrayList;

/**
 *
 * @author I040022
 */
public class CurrentForm {
    public static FormStructure getCurrentFormStructure(){
        ArrayList<AbstractQuestion> questionList = new ArrayList<AbstractQuestion>();

        // create text list for translated question texts
        ArrayList<TextItem> question1TextList = new ArrayList<TextItem>();

        // create simple question with the previously created translations
        SimpleQuestion question1 = new SimpleQuestion("Username",AbstractQuestion.TYPE_INPUT_TEXT, AbstractQuestion.TYPE_DATA_STRING,question1TextList);
        question1.setConstraintMessage("This is not a valid username.");
        question1.setConstraint("regex(., '[A-Za-z]{3}[0-9]{3}')");
        questionList.add(question1);

        // create translated text in the selected language
        TextItem question1_EN = new TextItem("English", "Username?");
        question1TextList.add(question1_EN);
        // create translated text in different language for the same question
        TextItem question1_DE = new TextItem("German", "Benutzername?");
        question1TextList.add(question1_DE);

        ArrayList<TextItem> question1ATextList = new ArrayList<TextItem>();
        SimpleQuestion question1A = new SimpleQuestion("UsernameBarcode",AbstractQuestion.TYPE_INPUT_TEXT, AbstractQuestion.TYPE_DATA_BARCODE,question1ATextList);
        question1A.setRequired(true);
        question1A.setRelevant("selected(/RegistrationForm/Username, '')");
        questionList.add(question1A);
        TextItem question1A_EN = new TextItem("English", "No username entered. Please scan the label instead.");
        question1ATextList.add(question1A_EN);
        // create translated text in different language for the same question
        TextItem question1A_DE = new TextItem("German", "Kein Name eingegeben. Bitte scannen Sie das Etikett.");
        question1ATextList.add(question1A_DE);

        ArrayList<TextItem> question2TextList = new ArrayList<TextItem>();
        SimpleQuestion question2 = new SimpleQuestion("Email",AbstractQuestion.TYPE_INPUT_TEXT, AbstractQuestion.TYPE_DATA_STRING,question2TextList);
        questionList.add(question2);
        TextItem question2_EN = new TextItem("English", "Do you have an email address?");
        question2TextList.add(question2_EN);
        // create translated text in different language for the same question
        TextItem question2_DE = new TextItem("German", "Haben Sie eine E-Mail-Adresse?");
        question2TextList.add(question2_DE);

        ArrayList<TextItem> question3TextList = new ArrayList<TextItem>();
        SimpleQuestion question3 = new SimpleQuestion("Mobile",AbstractQuestion.TYPE_INPUT_TEXT, AbstractQuestion.TYPE_DATA_STRING,question3TextList);
        questionList.add(question3);
        TextItem question3_EN = new TextItem("English", "What is your mobile number?");
        question3TextList.add(question3_EN);
        // create translated text in different language for the same question
        TextItem question3_DE = new TextItem("German", "Was ist Ihre Handy-Nummer?");
        question3TextList.add(question3_DE);

        ArrayList<TextItem> question4TextList = new ArrayList<TextItem>();
        SimpleQuestion question4 = new SimpleQuestion("Name",AbstractQuestion.TYPE_INPUT_TEXT, AbstractQuestion.TYPE_DATA_STRING,question4TextList);
        questionList.add(question4);
        TextItem question4_EN = new TextItem("English", "What is your name?");
        question4TextList.add(question4_EN);
        // create translated text in different language for the same question
        TextItem question4_DE = new TextItem("German", "Wie ist Ihr Name?");
        question4TextList.add(question4_DE);

        ArrayList<TextItem> question5TextList = new ArrayList<TextItem>();
        SimpleQuestion question5 = new SimpleQuestion("Nickname",AbstractQuestion.TYPE_INPUT_TEXT, AbstractQuestion.TYPE_DATA_STRING,question5TextList);
        questionList.add(question5);
        TextItem question5_EN = new TextItem("English", "What is your nickname, initials or any other names you would like to register with?");
        question5TextList.add(question5_EN);
        // create translated text in different language for the same question
        TextItem question5_DE = new TextItem("German", "Was ist Ihr Spitzname, Initialen oder andere Namen, die Sie gerne registrieren würde?");
        question5TextList.add(question5_DE);

        ArrayList<TextItem> question6TextList = new ArrayList<TextItem>();
        SimpleQuestion question6 = new SimpleQuestion("Age",AbstractQuestion.TYPE_INPUT_TEXT, AbstractQuestion.TYPE_DATA_INT,question6TextList);
        questionList.add(question6);
        TextItem question6_EN = new TextItem("English", "What is your age?");
        question6TextList.add(question6_EN);
        // create translated text in different language for the same question
        TextItem question6_DE = new TextItem("German", "Wie alt sind Sie?");
        question6TextList.add(question6_DE);

        ArrayList<TextItem> question7TextList = new ArrayList<TextItem>();
        SimpleQuestion question7 = new SimpleQuestion("LastSeenPlace",AbstractQuestion.TYPE_INPUT_TEXT, AbstractQuestion.TYPE_DATA_STRING,question7TextList);
        questionList.add(question7);
        TextItem question7_EN = new TextItem("English", "Where did you last see the person or persons you are looking for?");
        question7TextList.add(question7_EN);
        // create translated text in different language for the same question
        TextItem question7_DE = new TextItem("German", "Wo haben Sie zuletzt gesehen die Person oder Personen, die Sie suchen?");
        question7TextList.add(question7_DE);


        ArrayList<SelectOption> selectOptions = new ArrayList<SelectOption>();
        ArrayList<TextItem> option1Texts = new ArrayList<TextItem>();
        TextItem option1_EN = new TextItem("English", "Eritrea");
        option1Texts.add(option1_EN);
        TextItem option1_DE = new TextItem("German", "Eritrea");
        option1Texts.add(option1_DE);
        ArrayList<TextItem> option2Texts = new ArrayList<TextItem>();
        TextItem option2_EN = new TextItem("English", "Ethiopia");
        option2Texts.add(option2_EN);
        TextItem option2_DE = new TextItem("German", "Ethiopia");
        option2Texts.add(option2_DE);
        ArrayList<TextItem> option3Texts = new ArrayList<TextItem>();
        TextItem option3_EN = new TextItem("English", "DR-Congo");
        option3Texts.add(option3_EN);
        TextItem option3_DE = new TextItem("German", "DR-Congo");
        option3Texts.add(option3_DE);
        ArrayList<TextItem> option4Texts = new ArrayList<TextItem>();
        TextItem option4_EN = new TextItem("English", "Kenya");
        option4Texts.add(option4_EN);
        TextItem option4_DE = new TextItem("German", "Kenya");
        option4Texts.add(option4_DE);
        ArrayList<TextItem> option5Texts = new ArrayList<TextItem>();
        TextItem option5_EN = new TextItem("English", "Sudan");
        option5Texts.add(option5_EN);
        TextItem option5_DE = new TextItem("German", "Sudan");
        option5Texts.add(option5_DE);
        ArrayList<TextItem> option6Texts = new ArrayList<TextItem>();
        TextItem option6_EN = new TextItem("English", "Somalia");
        option6Texts.add(option6_EN);
        TextItem option6_DE = new TextItem("German", "Somalia");
        option6Texts.add(option6_DE);

        SelectOption option1 = new SelectOption("1", "1", option1Texts);
        SelectOption option2 = new SelectOption("2", "2", option2Texts);
        SelectOption option3 = new SelectOption("3", "3", option3Texts);
        SelectOption option4 = new SelectOption("4", "4", option4Texts);
        SelectOption option5 = new SelectOption("5", "5", option5Texts);
        SelectOption option6 = new SelectOption("6", "6", option6Texts);

        ArrayList<TextItem> question8TextList = new ArrayList<TextItem>();
        SelectQuestion question8 = new SelectQuestion("BornCountry",AbstractQuestion.TYPE_INPUT_SELECT, AbstractQuestion.TYPE_DATA_STRING,question8TextList, selectOptions);
        question8.getSelectOptions().add(option1);
        question8.getSelectOptions().add(option2);
        question8.getSelectOptions().add(option3);
        question8.getSelectOptions().add(option4);
        question8.getSelectOptions().add(option5);
        question8.getSelectOptions().add(option6);
        questionList.add(question8);
        TextItem question8_EN = new TextItem("English", "In what country were you born?");
        question8TextList.add(question8_EN);
        // create translated text in different language for the same question
        TextItem question8_DE = new TextItem("German", "In welchem Land sind Sie geboren?");
        question8TextList.add(question8_DE);

        ArrayList<SelectOption> question9selectOptions = new ArrayList<SelectOption>();
        ArrayList<TextItem> question9option1Texts = new ArrayList<TextItem>();
        TextItem question9option1_EN = new TextItem("English", "Male");
        question9option1Texts.add(question9option1_EN);
        TextItem question9option1_DE = new TextItem("German", "Mann");
        question9option1Texts.add(question9option1_DE);
        ArrayList<TextItem> question9option2Texts = new ArrayList<TextItem>();
        TextItem question9option2_EN = new TextItem("English", "Female");
        question9option2Texts.add(question9option2_EN);
        TextItem question9option2_DE = new TextItem("German", "Frau");
        question9option2Texts.add(question9option2_DE);
        ArrayList<TextItem> question9option3Texts = new ArrayList<TextItem>();
        TextItem question9option3_EN = new TextItem("English", "Secret");
        question9option3Texts.add(question9option3_EN);
        TextItem question9option3_DE = new TextItem("German", "Geheimnis");
        question9option3Texts.add(question9option3_DE);

        SelectOption question9option1 = new SelectOption("Male", "Male", question9option1Texts);
        SelectOption question9option2 = new SelectOption("Female", "Female", question9option2Texts);
        SelectOption question9option3 = new SelectOption("Secret", "Secret", question9option3Texts);

        ArrayList<TextItem> question9TextList = new ArrayList<TextItem>();
        SelectQuestion question9 = new SelectQuestion("Sex",AbstractQuestion.TYPE_INPUT_SELECT, AbstractQuestion.TYPE_DATA_STRING,question9TextList, question9selectOptions);
        question9.getSelectOptions().add(question9option1);
        question9.getSelectOptions().add(question9option2);
        question9.getSelectOptions().add(question9option3);
        questionList.add(question9);
        TextItem question9_EN = new TextItem("English", "Are you male or female?");
        question9TextList.add(question9_EN);
        // create translated text in different language for the same question
        TextItem question9_DE = new TextItem("German", "Sind Sie mann oder frau?");
        question9TextList.add(question9_DE);

        ArrayList<TextItem> question10TextList = new ArrayList<TextItem>();
        SimpleQuestion question10 = new SimpleQuestion("NameOfHometown",AbstractQuestion.TYPE_INPUT_TEXT, AbstractQuestion.TYPE_DATA_STRING,question10TextList);
        questionList.add(question10);
        TextItem question10_EN = new TextItem("English", "What is the name of your home town or village?");
        question10TextList.add(question10_EN);
        // create translated text in different language for the same question
        TextItem question10_DE = new TextItem("German", "Was ist der Name Ihrer Stadt oder Gemeinde?");
        question10TextList.add(question10_DE);

        ArrayList<TextItem> question11TextList = new ArrayList<TextItem>();
        SimpleQuestion question11 = new SimpleQuestion("Tribe",AbstractQuestion.TYPE_INPUT_TEXT, AbstractQuestion.TYPE_DATA_STRING,question11TextList);
        questionList.add(question11);
        TextItem question11_EN = new TextItem("English", "Do you belong to any clan, tribe or group?");
        question11TextList.add(question11_EN);
        // create translated text in different language for the same question
        TextItem question11_DE = new TextItem("German", "Gehören Sie zu jeder Clan, Stamm oder eine Gruppe?");
        question11TextList.add(question11_DE);

        ArrayList<TextItem> question12TextList = new ArrayList<TextItem>();
        SimpleQuestion question12 = new SimpleQuestion("OtherInfo",AbstractQuestion.TYPE_INPUT_TEXT, AbstractQuestion.TYPE_DATA_STRING,question12TextList);
        questionList.add(question12);
        TextItem question12_EN = new TextItem("English", "Do you have any other information that would help the person you are looking for in identifying you?");
        question12TextList.add(question12_EN);
        // create translated text in different language for the same question
        TextItem question12_DE = new TextItem("German", "Haben Sie andere Informationen, die die Person, die Sie auf der Suche nach der Identifizierung Ihnen helfen würde?");
        question12TextList.add(question12_DE);

        // create form with the previously created questions
        FormStructure struct = new FormStructure("Registration Form", questionList);
        return struct;
    }
}
